***                                                                                                                                                                                                                                                       
***                                                                                                                                                                                                                                                       
*** This Program already converted to Y2K                                                                                                                                                                                                                 
*** S&T Departement     on 29 April 1999 by Ben.Rahman                                                                                                                                                                                                    
***                                                                                                                                                                                                                                                       
***                                                                                                                                                                                                                                                       
set cent on                                                                                                                                                                                                                                               
store 0 to namelen,namel,pwl1,l11,l12,l13,l14,l15,l16,l17,l18,l19,l20,compt,cn,n01,PLW,pwli                                                                                                                                                               
store space(10) to pw1, pw2                                                                                                                                                                                                                               
store space(30) to voidpw,vpw                                                                                                                                                                                                                             
p01=space(1)                                                                                                                                                                                                                                              
store .f. to exactpw                                                                                                                                                                                                                                      
store ctod('  /  /    ') to dwv                                                                                                                                                                                                                           
do namelenG                                                                                                                                                                                                                                               
vpw=valid_pw                                                                                                                                                                                                                                              
if vpw=space(30)                                                                                                                                                                                                                                          
   do codat                                                                                                                                                                                                                                               
   if rec_lock(0)                                                                                                                                                                                                                                         
      repl valid_pw with voidpw                                                                                                                                                                                                                           
   endif                                                                                                                                                                                                                                                  
endif                                                                                                                                                                                                                                                     
do decodat                                                                                                                                                                                                                                                
if dwv<date()                                                                                                                                                                                                                                             
   SET COLOR TO W/BG                                                                                                                                                                                                                                      
   @ 12,4 clea to 22,75                                                                                                                                                                                                                                   
   do boxf with 13,6,'Your PASSWORD is EXPIRED, You will have to CREATE ANOTHER ONE','gr+','r','gr+*',.t.,.t.                                                                                                                                             
   do boxt with 18,21,'Type Any Key !!! ... ','gr+','r',.t.,.t.                                                                                                                                                                                           
   set cons off                                                                                                                                                                                                                                           
   wait ' '                                                                                                                                                                                                                                               
   set cons on                                                                                                                                                                                                                                            
   do makepw                                                                                                                                                                                                                                              
else                                                                                                                                                                                                                                                      
   do boxt with 18,21,'Minimum 5, Maximum 10 letters long','gr+','r',.t.,.t.                                                                                                                                                                              
   do while .not. exactpw  .and. compt<3 .and. lastkey()<>27                                                                                                                                                                                              
      compt=compt+1                                                                                                                                                                                                                                       
      do while pwl1<5                                                                                                                                                                                                                                     
         do boxe with 13,21,"Enter your PASSWORD :",'pw1','w+','b','X','n',10,.t.,.t.                                                                                                                                                                     
         IF LASTKEY()=27                                                                                                                                                                                                                                  
            RETURN                                                                                                                                                                                                                                        
         ENDIF                                                                                                                                                                                                                                            
         pwl1=len(alltrim(pw1))                                                                                                                                                                                                                           
         pwli=asc(str(pwl1,1,0))                                                                                                                                                                                                                          
      enddo                                                                                                                                                                                                                                               
      pwl1=len(alltrim(pw1))                                                                                                                                                                                                                              
      pwli=asc(str(pwl1,1,0))                                                                                                                                                                                                                             
      n01=pwli*namel*asc(staf_name)                                                                                                                                                                                                                       
      divid=int(n01/142)                                                                                                                                                                                                                                  
      multip=divid*142                                                                                                                                                                                                                                    
      addit=n01-multip                                                                                                                                                                                                                                    
      res=addit+32                                                                                                                                                                                                                                        
      p01=chr(res)                                                                                                                                                                                                                                        
      if p01<>left(staf_pw,1)                                                                                                                                                                                                                             
         do wrongpw                                                                                                                                                                                                                                       
         loop                                                                                                                                                                                                                                             
      endif                                                                                                                                                                                                                                               
      l11=asc(left(pw1,1))                                                                                                                                                                                                                                
      l12=asc(substr(pw1,2,1))                                                                                                                                                                                                                            
      l13=asc(substr(pw1,3,1))                                                                                                                                                                                                                            
      l14=asc(substr(pw1,4,1))                                                                                                                                                                                                                            
      l15=asc(substr(pw1,5,1))                                                                                                                                                                                                                            
      if pwl1>5                                                                                                                                                                                                                                           
         l16=asc(substr(pw1,6,1))                                                                                                                                                                                                                         
         if pwl1>6                                                                                                                                                                                                                                        
            l17=asc(substr(pw1,7,1))                                                                                                                                                                                                                      
            if pwl1>7                                                                                                                                                                                                                                     
               l18=asc(substr(pw1,8,1))                                                                                                                                                                                                                   
               if pwl1>8                                                                                                                                                                                                                                  
                  l19=asc(substr(pw1,9,1))                                                                                                                                                                                                                
                  if pwl1>9                                                                                                                                                                                                                               
                     l20=asc(substr(pw1,10,1))                                                                                                                                                                                                            
                  endif                                                                                                                                                                                                                                   
               endif                                                                                                                                                                                                                                      
            endif                                                                                                                                                                                                                                         
         endif                                                                                                                                                                                                                                            
      endif                                                                                                                                                                                                                                               
      store 0 to n01,n02,n03,n04,n05,n06,n07,n08,n09,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n33,n34,n35,n36,n37,n38,n39,n40                                                                          
      store space(1) to p01,p02,p03,p04,p05,p06,p07,p08,p09,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29,p30,p31,p32,p33,p34,p35,p36,p37,p38,p39,p40                                                                   
      do transfor                                                                                                                                                                                                                                         
      do while cn<40                                                                                                                                                                                                                                      
         cn=cn+1                                                                                                                                                                                                                                          
         if cn<10                                                                                                                                                                                                                                         
            cnn='0'+str(cn,1,0)                                                                                                                                                                                                                           
         else                                                                                                                                                                                                                                             
            cnn=str(cn,2,0)                                                                                                                                                                                                                               
         endif                                                                                                                                                                                                                                            
         prevar='n'+cnn                                                                                                                                                                                                                                   
         divid=int(&prevar/142)                                                                                                                                                                                                                           
         multip=divid*142                                                                                                                                                                                                                                 
         addit=&prevar-multip                                                                                                                                                                                                                             
         res=addit+32                                                                                                                                                                                                                                     
         futvar='p'+cnn                                                                                                                                                                                                                                   
         &futvar=chr(res)                                                                                                                                                                                                                                 
      enddo                                                                                                                                                                                                                                               
      result=p01+p02+p03+p04+p05+p06+p07+p08+p09+p10+p11+p12+p13+p14+p15+p16+p17+p18+p19+p20+p21+p22+p23+p24+p25+p26+p27+p28+p29+p30+p31+p32+p33+p34+p35+p36+p37+p38+p39+p40                                                                              
      if result=staf_pw                                                                                                                                                                                                                                   
         exactpw=.t.                                                                                                                                                                                                                                      
      ELSE                                                                                                                                                                                                                                                
         do wrongpw                                                                                                                                                                                                                                       
      endif                                                                                                                                                                                                                                               
   enddo                                                                                                                                                                                                                                                  
   if lastkey()=27                                                                                                                                                                                                                                        
      return                                                                                                                                                                                                                                              
   endif                                                                                                                                                                                                                                                  
   if compt>2 .or. dwv<date()+15                                                                                                                                                                                                                          
      SET COLOR TO B/BG                                                                                                                                                                                                                                   
      @ 2,4 CLEA TO 22,75                                                                                                                                                                                                                                 
      DO BOX2 WITH 8,12,'Do You Want to Change Your PASSWORD :','YES','NO','GR+','R','GR+','N',PLW,.T.,.T.                                                                                                                                                
      IF PLW=1                                                                                                                                                                                                                                            
         DO MAKEPW                                                                                                                                                                                                                                        
      ENDIF                                                                                                                                                                                                                                               
   endif                                                                                                                                                                                                                                                  
endif                                                                                                                                                                                                                                                     
return                                                                                                                                                                                                                                                    
